package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingPlanPageQueryDto;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingPlanMapper {

    /**
     * 分页条件查询护理方案
     *
     * @param dto 查询参数
     * @return 符合条件的护理方案列表
     */
    Page<NursingPlanVo> pageQuery(NursingPlanPageQueryDto dto);

    /**
     * 新增护理计划
      * @param nursingPlan
     */
    void insert(NursingPlan nursingPlan);

    /**
     * 根据ID查询护理计划
     * @param id
     * @return
     */
    NursingPlan getById(Long id);

    /**
     * 根据ID修改护理计划
     * @param nursingPlan
     */
    void update(NursingPlan nursingPlan);

    /**
     * 根据ID删除护理计划
     * @param id
     */
    @Delete("delete from nursing_plan where id =#{id}")
    void deleteById(Long id);

    /**
     * 查询所有护理计划
     * @return
     */
    @Select("select * from nursing_plan where status = 1")
    List<NursingPlan> list();
}
